package com.tencreat.mall.controller.admin;

import com.tencreat.common.core.HttpResult;
import com.tencreat.common.core.controller.BaseController;
import com.tencreat.domain.mall.Dividend;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 描述信息
 *
 * @Author yaoruiqi
 * @Company: 深圳腾创互联科技有限公司
 * @link: https://tencreat.com
 * @Date: 2023/11/14 15:43
 */

@Api(tags="分红配置api")
@RestController
@RequestMapping("/dividend")
public class AdminDividendController extends BaseController {


    @GetMapping("/dividendSetting")
    @ApiOperation("分红账户配置")
    HttpResult<Dividend> dividendSetting() {
        return HttpResult.ok(new Dividend().select());
    }


    @PostMapping("/updateDividendSetting")
    @ApiOperation("修改分红账户配置")
    HttpResult<Void> updateDividendSetting(@RequestBody @Validated Dividend dividend) {
        dividend.update();
        return HttpResult.ok();
    }
}
